<style scoped>
.layout {
	border: 1px solid #d7dde4;
	background: url('../../assets/images/bg.jpg');
	background-size: 100% 100%;
}
.layout-logo {
	width: 400px;
	height: 58px;
	background: #5b6270;
	border-radius: 3px;
	float: left;
	position: relative;
	/* top: 15px;
        left: 20px; */
}
.layout-nav {
	width: 420px;
	margin: 0 auto;
}
.layout-assistant {
	width: 300px;
	margin: 0 auto;
	height: inherit;
}
.layout-breadcrumb {
	padding: 10px 15px 0;
}
.layout-content {
	min-height: 1000px;
	margin: 15px;
	overflow: hidden;
	border-radius: 0px;
}
.layout-content-main {
	padding: 10px;
}
.layout-copy {
	text-align: center;
	padding: 10px 0 20px;
	color: #fff;
}
.item-name {
	font-weight: 800;
}
</style>
<template>
	<div class="layout">
		<Menu mode="horizontal" active-name="1" ref="layoutMenu" theme="light" style="height: 64px;line-height: 64px;background-color:#3A64FF">
			<div class="layout-logo" style="background-color: transparent;" @click="getHome()">
				<!-- <img style="padding:0px 10px;width:100%;height: 100%;margin-top: 10px;" src="../../assets/images/logo.jpg" /> -->
			</div>
			<user style="float: right;padding-right: 25px;" :user-name="userName" />
		</Menu>
		<div class="layout-content" ref="layoutContent">
			<div style="padding:20px 80px">
				<keep-alive>
					<router-view v-if="!$route.meta.notCache"></router-view>
				</keep-alive>
				<router-view v-if="$route.meta.notCache"></router-view>
			</div>
		</div>
	</div>
</template>
<script>
import User from './components/user';
import { mapMutations, mapActions, mapGetters } from 'vuex';
export default {
	components: {
		User
	},
	mounted() {
		// window.onresize = () => {
		// 	return (() => {
		// 		var w = document.documentElement.clientWidth || document.body.clientWidth;
		// 		var h = document.documentElement.clientHeight || document.body.clientHeight;
		// 		var offsetHeight = h - this.$refs.layoutMenu.$el.clientHeight - 150;
		// 		this.$refs.layoutContent.style.height = offsetHeight + 'px';
		// 	})();
		// };
	},
	data() {
		return {};
	},
	computed: {
		userName() {
			return this.$store.state.user.userName;
		}
	},
	methods: {
		getHome() {
			this.$router.push({ name: 'home' });
		}
	}
};
</script>
